﻿CREATE PROCEDURE [acms].[TopicGroup_Delete]
	@Id int, 
	@ConcurencyId rowversion
AS
	if exists(select null from TopicGroup_View with(nolock) where Id = @Id and ConcurencyId = @ConcurencyId)	begin
		update TopicGroup set Deleted = 1 where Id = @Id and ConcurencyId = @ConcurencyId
	end
	else if exists(select null from TopicGroup_View with(nolock) where Id = @Id) begin
		return -100
	end
	else begin
		return -200
	end

RETURN 0;